# Defines without value
foreach(
  def_name
  NOSOUND
  NONET
  NOEXIT
  PREFILL_PLAYER_NAME
  DISABLE_TCP
  DISABLE_ZERO_TIER
  DISABLE_STREAMING_MUSIC
  DISABLE_STREAMING_SOUNDS
  DISABLE_DEMOMODE
  BUILD_TESTING
  GPERF
  GPERF_HEAP_MAIN
  GPERF_HEAP_FIRST_GAME_ITERATION
  PACKET_ENCRYPTION
  DEVILUTIONX_RESAMPLER_SPEEX
  DEVILUTIONX_RESAMPLER_SDL
  DEVILUTIONX_PALETTE_TRANSPARENCY_BLACK_16_LUT
  SCREEN_READER_INTEGRATION
  UNPACKED_MPQS
  UNPACKED_SAVES
  DEVILUTIONX_WINDOWS_NO_WCHAR
)
  if(${def_name})
    list(APPEND DEVILUTIONX_DEFINITIONS ${def_name})
  endif()
endforeach(def_name)

# Defines with value
foreach(
  def_name
  DEFAULT_WIDTH
  DEFAULT_HEIGHT
  DEFAULT_AUDIO_SAMPLE_RATE
  DEFAULT_AUDIO_CHANNELS
  DEFAULT_AUDIO_BUFFER_SIZE
  DEFAULT_AUDIO_RESAMPLING_QUALITY
  DEFAULT_PER_PIXEL_LIGHTING
  SDL1_VIDEO_MODE_BPP
  SDL1_VIDEO_MODE_FLAGS
  SDL1_VIDEO_MODE_SVID_FLAGS
  SDL1_FORCE_SVID_VIDEO_MODE
  SDL1_FORCE_DIRECT_RENDER
  DEVILUTIONX_GAMEPAD_TYPE
  HAS_KBCTRL
  KBCTRL_BUTTON_DPAD_LEFT
  KBCTRL_BUTTON_DPAD_RIGHT
  KBCTRL_BUTTON_DPAD_UP
  KBCTRL_BUTTON_DPAD_DOWN
  KBCTRL_BUTTON_B
  KBCTRL_BUTTON_A
  KBCTRL_BUTTON_Y
  KBCTRL_BUTTON_X
  KBCTRL_BUTTON_LEFTSTICK
  KBCTRL_BUTTON_RIGHTSTICK
  KBCTRL_BUTTON_RIGHTSHOULDER
  KBCTRL_BUTTON_LEFTSHOULDER
  KBCTRL_BUTTON_TRIGGERLEFT
  KBCTRL_BUTTON_TRIGGERRIGHT
  KBCTRL_BUTTON_START
  KBCTRL_BUTTON_BACK
  KBCTRL_IGNORE_1
  JOY_AXIS_LEFTX
  JOY_AXIS_LEFTY
  JOY_AXIS_RIGHTX
  JOY_AXIS_RIGHTY
  JOY_HAT_DPAD_UP_HAT
  JOY_HAT_DPAD_UP
  JOY_HAT_DPAD_DOWN_HAT
  JOY_HAT_DPAD_DOWN
  JOY_HAT_DPAD_LEFT_HAT
  JOY_HAT_DPAD_LEFT
  JOY_HAT_DPAD_RIGHT_HAT
  JOY_HAT_DPAD_RIGHT
  JOY_BUTTON_DPAD_LEFT
  JOY_BUTTON_DPAD_RIGHT
  JOY_BUTTON_DPAD_UP
  JOY_BUTTON_DPAD_DOWN
  JOY_BUTTON_B
  JOY_BUTTON_A
  JOY_BUTTON_Y
  JOY_BUTTON_X
  JOY_BUTTON_LEFTSTICK
  JOY_BUTTON_RIGHTSTICK
  JOY_BUTTON_RIGHTSHOULDER
  JOY_BUTTON_LEFTSHOULDER
  JOY_BUTTON_TRIGGERLEFT
  JOY_BUTTON_TRIGGERRIGHT
  JOY_BUTTON_START
  JOY_BUTTON_BACK
  REMAP_KEYBOARD_KEYS
  DEVILUTIONX_DEFAULT_RESAMPLER
  STREAM_ALL_AUDIO_MIN_FILE_SIZE
  DEVILUTIONX_DISPLAY_TEXTURE_FORMAT
  DEVILUTIONX_SCREENSHOT_FORMAT
  DARWIN_MAJOR_VERSION
  DARWIN_MINOR_VERSION
)
  if(DEFINED ${def_name} AND NOT ${def_name} STREQUAL "")
    list(APPEND DEVILUTIONX_DEFINITIONS ${def_name}=${${def_name}})
  endif()
endforeach(def_name)
